<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:app="http://org.wsiz.vro/app"
	xmlns:appcc="http://java.sun.com/jsf/composite/components">

	<app:panelTopMenu>

		<p:panel header="#{msg.welcome}">
			<p>
				<h:outputFormat value="#{msg.you_are_connected_to}"
					rendered="#{not userContext.isAnonymousUser()}">
					<f:param value="#{userContext.username}" />
					<f:param value="#{msg.application_name}" />
				</h:outputFormat>
				<p:outputPanel
					rendered="#{userContext.isAnonymousUser() and !(userContext.locale eq 'fr')}">
				Please <h:outputLink value="login">login first</h:outputLink> in order to access the application content. 
			</p:outputPanel>
				<p:outputPanel
					rendered="#{not userContext.isAnonymousUser() and (userContext.locale eq 'fr')}">
					<h:outputLink value="login">Connectez-vous</h:outputLink> afin d'accéder au contenu. 
			</p:outputPanel>
			</p>
		</p:panel>

		<p:panel header="Start a new flow"
			rendered="#{!(userContext.locale eq 'fr')}">
			<p>Here is the list of top level flows:</p>
			<ul>
				<li><h:outputLink value="account?mode=embedded">
						<h:outputText value="${msg.account} Flow" />
					</h:outputLink> (2 associations)</li>
				<li><h:outputLink value="address?mode=embedded">
						<h:outputText value="${msg.address} Flow" />
					</h:outputLink> (0 associations)</li>
				<li><h:outputLink value="film?mode=embedded">
						<h:outputText value="${msg.film} Flow" />
					</h:outputLink> (1 associations)</li>
				<li><h:outputLink value="role?mode=embedded">
						<h:outputText value="${msg.role} Flow" />
					</h:outputLink> (0 associations)</li>
			</ul>
		</p:panel>

		<p:panel header="Démarrer un nouveau flow"
			rendered="#{(userContext.locale eq 'fr')}">
			<p>Voici la liste des flows de haut niveau générés:</p>
			<ul>
				<li><h:outputLink value="account?mode=embedded">
						<h:outputText value="${msg.account} Flow" />
					</h:outputLink> (2 associations)</li>
				<li><h:outputLink value="address?mode=embedded">
						<h:outputText value="${msg.address} Flow" />
					</h:outputLink> (0 associations)</li>
				<li><h:outputLink value="film?mode=embedded">
						<h:outputText value="${msg.film} Flow" />
					</h:outputLink> (1 associations)</li>
				<li><h:outputLink value="role?mode=embedded">
						<h:outputText value="${msg.role} Flow" />
					</h:outputLink> (0 associations)</li>
			</ul>
		</p:panel>

	</app:panelTopMenu>
</ui:composition>